package com.kksoft.readcm.a;

import android.content.Context;
import android.database.SQLException;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import com.kksoft.readcm.activity.App;

final class ak extends SQLiteOpenHelper
{
  ak(Context paramContext)
  {
    super(paramContext, "ril", null, 5);
  }

  public final void onCreate(SQLiteDatabase paramSQLiteDatabase)
  {
    try
    {
      paramSQLiteDatabase.execSQL("CREATE TABLE sync_queue (type VARCHAR NOT NULL, url VARCHAR NOT NULL, PRIMARY KEY(url, type));");
      paramSQLiteDatabase.execSQL("CREATE TABLE items (item_id INTEGER NOT NULL, unique_id INTEGER NOT NULL, given_url VARCHAR, given_normal_url VARCHAR, resolved_url VARCHAR, resolved_normal_url VARCHAR, domain VARCHAR, title VARCHAR NOT NULL, time_added INTEGER NOT NULL, offline_web INTEGER NOT NULL, offline_text INTEGER NOT NULL, is_not_article INTEGER NOT NULL, percent INTEGER NOT NULL, encoding VARCHAR, mime VARCHAR, resolved_title VARCHAR, excerpt VARCHAR, image VARCHAR, video VARCHAR, offline_thumb INTEGER);");
      paramSQLiteDatabase.execSQL("CREATE TABLE tags (item_id INTEGER NOT NULL, tag VARCHAR NOT NULL, PRIMARY KEY(item_id, tag));");
      paramSQLiteDatabase.execSQL("CREATE TABLE scroll (item_id INTEGER NOT NULL, view INTEGER NOT NULL, page INTEGER NOT NULL, node_index INTEGER NOT NULL, percent INTEGER NOT NULL, time_updated INTEGER NOT NULL, section INTEGER, PRIMARY KEY (item_id, view));");
      paramSQLiteDatabase.execSQL("CREATE TABLE assets (asset_domain VARCHAR NOT NULL UNIQUE);");
      paramSQLiteDatabase.execSQL("CREATE TABLE assets_items (asset_domain VARCHAR NOT NULL, item_id INTEGER NOT NULL, PRIMARY KEY (asset_domain, item_id));");
      paramSQLiteDatabase.execSQL("CREATE TABLE failed_hosts (host VARCHAR NOT NULL);");
      paramSQLiteDatabase.execSQL("CREATE TABLE items_images (item_id INTEGER NOT NULL, image_id INTEGER NOT NULL, src TEXT, caption TEXT, credit TEXT, PRIMARY KEY (item_id, image_id));");
      paramSQLiteDatabase.execSQL("CREATE TABLE items_videos (item_id INTEGER NOT NULL, video_id INTEGER NOT NULL, src TEXT, type INTEGER NOT NULL, vid VARCHAR, PRIMARY KEY (item_id, video_id));");
      return;
    }
    catch (SQLException localSQLException)
    {
      while (true)
        App.showError(localSQLException);
    }
  }

  public final void onUpgrade(SQLiteDatabase paramSQLiteDatabase, int paramInt1, int paramInt2)
  {
    int i = paramInt1;
    SQLiteDatabase localSQLiteDatabase = paramSQLiteDatabase;
    while (i < 5)
    {
      i += 1;
      localSQLiteDatabase.beginTransaction();
      localSQLiteDatabase.setTransactionSuccessful();
      localSQLiteDatabase.endTransaction();
    }
  }
}

/* Location:           E:\AndroidDecompiler\jd-gui-0.3.3.windows\newrclasses.dex.dex2jar.jar
 * Qualified Name:     com.kksoft.readcm.a.ak
 * JD-Core Version:    0.6.0
 */